package com.kmzx.one.project.mapper;

import com.kmzx.one.project.entity.UserOrder;
import com.kmzx.one.project.entity.UserOrderSubs;
import com.kmzx.one.project.others.dso.UserOrderDso;
import com.kmzx.one.project.others.dto.UserOrderMoreInfo;
import com.kmzx.one.project.others.vos.ExpressInfos;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface UserOrderMapper {

    List<UserOrderDso> selectUserOrderAllPager(@Param("userId") String userId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,
                                         @Param("kinds") Integer kinds);

    List<UserOrderDso> selectUserOrderAllPager2(@Param("userId") String userId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    UserOrderMoreInfo selectUserOrderDetail(@Param("orderId") String orderId);

    List<UserOrderDso> selectUserOrderSubDetail(@Param("orderId") String orderId);

    UserOrder selectById(@Param("id") String id);

    int updateByIdSelective(UserOrder order);

    int batchUpdateSubOrder(@Param("orderId") String orderId, @Param("states") int states, @Param("updateTime") Date updateTime);

    Map<String, String> selectSubOrderExpressInfo(@Param("orderId") String orderId);

    ExpressInfos selectOrderExpressInfo(@Param("subsCodes") String subsCodes);

    int insertExpress(ExpressInfos dto);

    int updateExpressDto(@Param("dto") ExpressInfos dto);

    int updateSubsByIdSelective(UserOrderSubs subs);

    UserOrderSubs selectSubsOrderById(@Param("orderId") String orderId);

    int insertMainOrder(UserOrder userOrder);

    int insertSubOrder(UserOrderSubs subs);

    List<String> selectOrderSubsInfo(@Param("orderId") String orderId);
    
    void batchUpdateUserOrderSubs(@Param("list") List<UserOrderSubs> list);

}
